package com.teamsapp.article.model;

public enum ArticleStatus {
    DRAFT(0),
    PUBLISHED(1);

    private final int value;

    ArticleStatus(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static ArticleStatus fromValue(int value) {
        for (ArticleStatus status : ArticleStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid ArticleStatus value: " + value);
    }
}
